/*
 * @Description:
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2023-05-30 15:47:06
 * @LastEditTime: 2023-06-05 16:08:06
 * @FilePath: \cscec-pms-admin\src\api\construction\contractor.js
 */
import request from '@/utils/request2'
import request1 from '@/utils/request'
import { projectApiUrl } from '@/api/config'
const api = {
  queryScheduleContractPlanTree: projectApiUrl + '/schedule-contract/query-schedule-contract-plan-tree',
  implementationKanbanShow: projectApiUrl + '/schedule-contract/implementation-kanban-show',
  implementationKanbanHidden: projectApiUrl + '/schedule-contract/implementation-kanban-hidden',
  onTimeCompleteRateDetail: projectApiUrl + '/schedule-contract/on-time-complete-rate-detail',
  completeRateDetail: projectApiUrl + '/schedule-contract/complete-rate-detail',
  contractPlanCalendar: projectApiUrl + '/schedule-contract/contract-plan-calendar',
  contractPlanExportProject: projectApiUrl + '/schedule-contract/contract-plan-export-project',
  contractPlanExportExcl: projectApiUrl + '/schedule-contract/contract-plan-export-excl',
  contractPlanDetailSearch: projectApiUrl + '/schedule-contract/contract-plan-detail-search',
  doubleNetworkPictureQuery: projectApiUrl + '/schedule-contract/double-network-picture-query',
  contractPlanExportList: projectApiUrl + '/schedule-contract/contract-plan-export-list',
  siblingWork: projectApiUrl + '/schedule-contract/sibling-work',
  createChildWork: projectApiUrl + '/schedule-contract/create-child-work',
  createChildWorkPack: projectApiUrl + '/schedule-contract/create-child-work-pack',
  createSiblingWorkPack: projectApiUrl + '/schedule-contract/create-sibling-work-pack',
  moveUp: projectApiUrl + '/schedule-contract/move-up',
  moveDown: projectApiUrl + '/schedule-contract/move-down',
  upgradeWorkPack: projectApiUrl + '/schedule-contract/upgrade-work-pack',
  downgradeWorkPack: projectApiUrl + '/schedule-contract/downgrade-work-pack',
  editWork: projectApiUrl + '/schedule-contract/edit-work',
  editWorkPack: projectApiUrl + '/schedule-contract/edit-work-pack',
  removeWork: projectApiUrl + '/schedule-contract/remove-work',
  removeWorkPack: projectApiUrl + '/schedule-contract/remove-work-pack',
  contractPlanSubmitApproval: projectApiUrl + '/schedule-contract/contract-plan-submit-approval',
  importProject: projectApiUrl + '/schedule-contract/import-project',
  importTemplate: projectApiUrl + '/schedule-contract/import-template',
  queryFrontTask: projectApiUrl + '/schedule-contract-front-task/query-front-task',
  queryFrontTaskTree: projectApiUrl + '/schedule-contract-front-task/query-front-task-tree',
  createFrontTask: projectApiUrl + '/schedule-contract-front-task/create-front-task',
  editFrontTask: projectApiUrl + '/schedule-contract-front-task/edit-front-task',
  deleteFrontTask: projectApiUrl + '/schedule-contract-front-task/delete-front-task',
  nodeList: projectApiUrl + '/schedule-contract/node-list'
}
export default {
  /**
   * @description: 获取合同计划列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryScheduleContractPlanTree: (data) => {
    return request({
      url: api.queryScheduleContractPlanTree,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取合同计划看板显示数据
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  implementationKanbanShow: (data) => {
    return request({
      url: `${api.implementationKanbanShow}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 获取合同计划看板隐藏数据
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  implementationKanbanHidden: (data) => {
    return request({
      url: `${api.implementationKanbanHidden}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 获取节点按时完成率
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  onTimeCompleteRateDetail: (data) => {
    return request({
      url: `${api.onTimeCompleteRateDetail}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 获取节点完成率
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  completeRateDetail: (data) => {
    return request({
      url: `${api.completeRateDetail}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 获取合同计划日历数据
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  contractPlanCalendar: (data) => {
    return request({
      url: api.contractPlanCalendar,
      method: 'post',
      data
    })
  },
  /**
   * @description: 合同计划导出project
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  contractPlanExportProject: (data) => {
    return request1({
      url: `${api.contractPlanExportProject}/${data}`,
      method: 'get',
      responseType: 'blob'
    })
  },
  /**
   * @description: 合同计划导出excel
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  contractPlanExportExcl: (data) => {
    return request1({
      url: `${api.contractPlanExportExcl}/${data}`,
      method: 'get',
      responseType: 'blob'
    })
  },
  /**
   * @description: 合同计划详情搜索
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  contractPlanDetailSearch: (data) => {
    return request({
      url: api.contractPlanDetailSearch,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取双代号网络图
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  doubleNetworkPictureQuery: (data) => {
    return request({
      url: `${api.doubleNetworkPictureQuery}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 列表导出全部
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  contractPlanExportList: (data) => {
    return request1({
      url: api.contractPlanExportList,
      method: 'post',
      responseType: 'blob',
      data
    })
  },
  /**
   * @description: 新增同级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  siblingWork: (data) => {
    return request({
      url: api.siblingWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增下级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWork: (data) => {
    return request({
      url: api.createChildWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增下级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWorkPack: (data) => {
    return request({
      url: api.createChildWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增同级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createSiblingWorkPack: (data) => {
    return request({
      url: api.createSiblingWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 上移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveUp: (data) => {
    return request({
      url: api.moveUp,
      method: 'post',
      data
    })
  },
  /**
   * @description: 下移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveDown: (data) => {
    return request({
      url: api.moveDown,
      method: 'post',
      data
    })
  },
  /**
   * @description: 升级
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  upgradeWorkPack: (data) => {
    return request({
      url: api.upgradeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 降级
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  downgradeWorkPack: (data) => {
    return request({
      url: api.downgradeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWork: (data) => {
    return request({
      url: api.editWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWorkPack: (data) => {
    return request({
      url: api.editWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWorkPack: (data) => {
    return request({
      url: api.removeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWork: (data) => {
    return request({
      url: api.removeWork,
      method: 'post',
      data
    })
  },
  /**
    * @description: 合同计划提交审批
    * @param {Object} data 接口参数
    * @return {Promise} 接口Promise
    */
  contractPlanSubmitApproval: data => {
    return request({
      url: api.contractPlanSubmitApproval,
      method: 'post',
      data
    })
  },
  /**
   * @description: 导入project
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  importProject: data => {
    return request({
      url: api.importProject,
      method: 'post',
      data
    })
  },
  /**
   * @description: 导入模板
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  importTemplate: data => {
    return request({
      url: api.importTemplate,
      method: 'post',
      data
    })
  },
  /**
    * @description: 获取前置任务列表
    * @param {Object} data 接口参数
    * @return {Promise} 接口Promise
    */
  queryFrontTask: data => {
    return request({
      url: `${api.queryFrontTask}/${data}`,
      method: 'get'
    })
  },
  /**
    * @description: 获取前置任务节点名称树
    * @param {Object} data 接口参数
    * @return {Promise} 接口Promise
    */
  queryFrontTaskTree: data => {
    return request({
      url: api.queryFrontTaskTree,
      method: 'post',
      data
    })
  },
  /**
    * @description: 新增前置任务
    * @param {Object} data 接口参数
    * @return {Promise} 接口Promise
    */
  createFrontTask: data => {
    return request({
      url: api.createFrontTask,
      method: 'post',
      data
    })
  },
  /**
    * @description: 编辑前置任务
    * @param {Object} data 接口参数
    * @return {Promise} 接口Promise
    */
  editFrontTask: data => {
    return request({
      url: api.editFrontTask,
      method: 'post',
      data
    })
  },
  /**
    * @description: 删除前置任务
    * @param {Object} data 接口参数
    * @return {Promise} 接口Promise
    */
  deleteFrontTask: data => {
    return request({
      url: api.deleteFrontTask,
      method: 'post',
      data
    })
  },
  /**
    * @description: 获取点信息列表
    * @param {Object} data 接口参数
    * @return {Promise} 接口Promise
    */
  nodeList: data => {
    return request({
      url: api.nodeList,
      method: 'post',
      data
    })
  }
}
